package com.module.pay.wx.http

import com.module.pay.wx.bean.WxPlay
import com.module.pay.wx.bean.WxPlayResult
import retrofit2.http.Body
import retrofit2.http.Header
import retrofit2.http.Headers
import retrofit2.http.POST

interface WxPayService {
    /**
     * V2版本下单
     */
    @POST("https://api.mch.weixin.qq.com/pay/unifiedorder")
    suspend fun addOrder(@Body xml: String): String


    /**
     * V3版本 最新版本下单
     */
    @Headers("Accept:application/json")
    @POST("https://api.mch.weixin.qq.com/v3/pay/transactions/app")
    suspend fun addOrder(
        @Header("Authorization") Authorization: String,
        @Body wxPlay: WxPlay
    ): WxPlayResult

}